<template>
  <div class="movie-section">
    <div class="section-header">
      <span class="section-tag">小谷粒福利</span>
    </div>
    
    <div class="movie-card" @click="handleMovieClick">
      <div class="movie-content">
        <h3 class="movie-title">谷粒请你看电影</h3>
        <div class="movie-image">
          <img src="@/assets/imgs/discover.png" alt="电影海报" class="poster-image" />
          <div class="movie-overlay">
            <div class="play-button">
              <span class="play-icon">▶</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ElMessage } from 'element-plus'

const handleMovieClick = () => {
  ElMessage.success('正在为您播放电影...')
}
</script>

<style scoped>
.movie-section {
  padding: 0 16px 20px;
}

.section-header {
  margin-bottom: 16px;
}

.section-tag {
  display: inline-block;
  background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.movie-card {
  background-color: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.movie-content {
  padding: 16px;
}

.movie-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  text-align: center;
}

.movie-image {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
}

.poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .poster-image {
  transform: scale(1.05);
}

.movie-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-card:hover .movie-overlay {
  opacity: 1;
}

.play-button {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-button:hover {
  transform: scale(1.1);
  background: #fff;
}

.play-icon {
  font-size: 20px;
  color: #4CAF50;
  margin-left: 3px; /* 视觉居中调整 */
}

/* 添加装饰元素 */
.movie-card::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  z-index: 10;
  animation: twinkle 2s ease-in-out infinite;
}

.movie-card::after {
  content: '';
  position: absolute;
  top: 20px;
  right: 25px;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #FF69B4, #FF1493);
  border-radius: 50%;
  z-index: 10;
  animation: twinkle 2s ease-in-out infinite 0.5s;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .movie-section {
    padding: 0 12px 16px;
  }
  
  .movie-content {
    padding: 12px;
  }
  
  .movie-title {
    font-size: 16px;
    margin: 0 0 12px 0;
  }
  
  .movie-image {
    height: 160px;
  }
  
  .section-tag {
    padding: 4px 10px;
    font-size: 11px;
  }
  
  .play-button {
    width: 50px;
    height: 50px;
  }
  
  .play-icon {
    font-size: 16px;
  }
}
</style>
